home *** CD-ROM | disk | FTP | other *** search
- {$G+
- _______________________________________________________________________
- / \
- | |
- | Hello dudes! Here it is. The very sloooow environment mapper in pascal. |
- | |
- | Firstly, I must thank Cono/Fiction for helping me out on a lot of sub- |
- | jects. A lot of this code is optimized/revised code from Cono's old |
- | routines, wich I learned from a lot. Because of him I got from WRITELN |
- | to this in about two years. So BIG BIG thanx. This engine, as slow as |
- | it is, was coded and tested on a 386dx/40. Yes yes, I need a new motha- |
- | bored and stuff. Anyway, it has also been tested on a 486dx4/120, but |
- | with a slow ISA video card (4200 CH/SEC), and it ran fine. On another |
- | DX4/120, cono's computer it also ran fine, and even looked nice. I have |
- | implemented some different environment maps, all PCX, converted with |
- | BINOBJ. Pat1 is a nice yellow plastic, Pat2 is weird stuff. Pat3 is a |
- | nice blue chrome, and Pat4 is some very light cloud like sphere. And |
- | there's also SILVER, wich is very nice, and my favorite, Sphere2. |
- | |
- | Well, it has a lot of bugs, and it isn't our final version. The SLINE |
- | routine for example, is still pure pascal. And the QSORT routine only |
- | sorts objects by Z value. But that's mainly why we released it, cos if |
- | we would release a perfect working version, bugfree, with full docs, |
- | coding wouldn't be fun anymore! Also, there are seperate pieces of code |
- | in here, with different coding styles. Don't pay attention to that, we |
- | coded it together, and we are both lame coders ;). Now stop reading this |
- | and go play! |
- | |
- | Contaction us: |
- | |
- | Inopia: |
- | |
- | Rynring 74 |
- | 5152 RB |
- | DRUNEN |
- | Tel: 0416374613 |
- | Fax: 0416377696 |
- | E-mail : NL1AFX@CBPACKHV.XS4ALL.NL |
- | |
- | If you decide to reach me by E-MAIL you'll have to wait at least a week |
- | be4 the messy reaches me, and at least another week b4 it gets back to |
- | you again. Sometimes it doesn't reach it's destination at all. (or some- |
- | times it doesn't even get send!, I mean you NiX!). So better snailmail. |
- | You can also leave a messy at one of our boreds, but I don't call em that|
- | much, exept for SL1210. (yet). |
- | |
- | SigneD : Inopia/Fiction |
- |/ \------------------------------------------------------------------------|
- \ /______________________________________________________________________ /
- }
- Program SumSlowEnvironmentMappedTorusInPascal;
-
- Uses Crt,VarUnit,GRUnit,MathUnit;
-
- {Replace all pat2 with some other object file for different environment maps }
-
- Procedure pat2; Far; External; {$L pat2.obj}
-
- Procedure Init;
- Begin
- For I := 0 To 360 Do Costab[i] := round(Cos(i*(pi/180))*256);
- For I := 0 To 360 Do Sintab[i] := round(Sin(i*(pi/180))*256);
- GetMem(Buffer,64000); MyFill(Buffer^,64000,0);
- GetMem(Emap,65534); MyFill(Emap^,65534,0);
- Xpos := 160; Ypos := 100; zpos := -200;
- Kickpcx2screen(@pat2,Emap^);
- End;
-
- begin
- Set320x200;
- Init;
- Calc_Normals;
- repeat
- Inc(Cnt);
- Inc(XCnt,4); If XCnt > 359 then XCnt := 0;
- Inc(YCnt,4); If YCnt > 359 then YCnt := 0;
- Inc(ZCnt,3); If ZCnt > 359 then ZCnt := 0;
- Rotate_Vertices;
- Rotate_Normals;
- Sort_Polyz;
- Place_Polys;
- MyMove(Buffer^,Mem[$A000:0],64000);
- MyFill(Buffer^,64000,0);
- Until KeyPressed;
- FreeMem(Buffer,64000);
- FreeMem(Emap,65534);
- SetText;
- end.
-
-
-
-
-